<div class="console-panel createAPI2  hide">
    <div class="console-panel-header">
        <span class="console-panel-header-line"></span>
        <div class="console-float-left ng-binding" style="font-weight: bold;">请求基础定义</div>
    </div>
    <div class="console-panel-body console-p4 console-pt6 console-pb6">

        <table width="100%">
            <tbody>
            <tr>
                <td style="padding-right:20px;text-align: right;border: 0" class="ng-binding">
                    <span class="red">* </span>请求路径
                </td>
                <td style="border: 0;">
                    <input type="text" id="path"
                           value="<#if context.api?? >${context.api.path}</#if>"
                           class="form-control w-25"
                           placeholder="请输入Path 示例: /test">
                </td>
            </tr>
            <tr>
                <td></td>
                <td style="padding-top: 0;">
                                        <span class="custom-comment-text">
                                        	请求Path必须以 / 开头,如果Path带请求参数需要加上 : 号,示例:[/test/:name]该Path会取name位置的值<br>
                                        	基于路径前缀通配请求可以使用/*,示例:[/path/*],所有以/path/起头的路径都会被会被匹配<br>
                                        	如果网关应用需要端口号复用需保证Path的唯一性,否则有可能在暂停应用的时候误停相同Path的API
										</span>
                </td>
            </tr>

            <tr>
                <td style="padding-right:20px;text-align: right;"
                    class="ng-binding">请求方法
                </td>
                <td>
                    <select type="text" id="method"
                            class="form-select w-25">
                        <#if context.api?? >
                            <option
                                    value="${context.api.method}">${context.api.method}
                            </option>
                        </#if>
                        <option value="ALL">ALL</option>
                        <option value="GET">GET</option>
                        <option value="HEAD">HEAD</option>
                        <option value="PUT">PUT</option>
                        <option value="POST">POST</option>
                        <option value="DELETE">DELETE</option>
                        <option value="PATCH">PATCH</option>
                        <option value="TRACE">TRACE</option>
                        <option value="CONNECT">CONNECT</option>
                        <option value="PATCH">PATCH</option>
                        <option value="OPTIONS">OPTIONS</option>
                        <option value="OTHER">OTHER</option>
                    </select>
                </td>
            </tr>

            <tr>
                <td style="padding-right:20px;text-align: right;border: 0;" class="ng-binding">
                    媒体类型/Content-Type
                </td>
                <td style="border: 0;">
                    <input type="text" id="consumes"
                            <#if context.api?? && context.api.consumes?exists> value="<#list context.api.consumes as item>${item}<#sep>,</#sep></#list>"</#if>
                           class="form-control w-50"
                           placeholder="请输入接收的处理类型,多个以,号隔开,默认所有类型">
                </td>
            </tr>
            <tr>
                <td style="border: 0;"></td>
                <td style="padding-top: 0;border: 0" >
                    <span class="custom-comment-text">设置API只处理请求Content-Type:为指定的类型的请求,* 代表任意 示例: */json
                        <br/>代表该API只处理请求Content-Type:任意/json结尾的数据格式,默认处理所有类型,多个以,号隔开 </span>
                </td>
            </tr>

            </tbody>
        </table>
    </div>

    <div class="console-panel console-mt4 mt-4">
        <div class="console-panel-header">
            <span class="console-panel-header-line"></span>
            <div class="console-float-left ng-binding" style="font-weight: bold;">入参定义</div>

        </div>
        <div class="request-param-setter ng-isolate-scope ng-pristine ng-valid newParam-setter">
            <table>
                <tbody>
                <tr>
                    <th width="150" class="ng-binding">参数名</th>
                    <th width="150" class="ng-binding">参数位置</th>
                    <th width="150" class="ng-binding">类型</th>
                    <th width="80" class="ng-binding">必填</th>
                    <th class="ng-binding">默认值</th>
                    <th class="ng-binding">描述</th>
                    <th class="ng-binding">操作</th>
                </tr>

                <#if context.api?? && context.api.enterParam?exists>
                    <#list context.api.enterParam as item>
                        <tr class="ng-scope"
                                <#if item.checkOptions?exists>
                                    <#if item.checkOptions.maxLength?exists> data-maxlen="${item.checkOptions.maxLength?c}"
                                    </#if>
                                    <#if item.checkOptions.maxValue?exists> data-maxv="${item.checkOptions.maxValue?c}"
                                    </#if>
                                    <#if item.checkOptions.minValue?exists> data-minv="${item.checkOptions.minValue?c}"
                                    </#if>
                                    <#if item.checkOptions.regex?exists> data-paramvify="${item.checkOptions.regex}"
                                    </#if>
                                    <#if item.checkOptions.enums?exists> data-enum="<#t><#list item.checkOptions.enums as item>${item}<#t> <#sep>,
</#sep></#list>"
                                    </#if>
                                    data-type="${item.paramType!}"
                                </#if>
                        >
                            <td><input value="${item.paramName!}"
                                       class="form-control w-25 paramName"
                                       type="text"></td>
                            <td>
                                <select class="form-select w-25 paramChange"
                                        onchange="paramPsHandle(this)">
                                    <option value="${item.position!}">${item.position!}</option>
                                    <option value="QUERY">QUERY</option>
                                    <option value="BODY">BODY</option>
                                    <option value="PATH">PATH</option>
                                    <option value="HEADER">HEADER</option>
                                </select>
                            </td>
                            <td>
                                <select class="form-select w-25 psType paramChange2">
                                    <option value="${item.paramType!}">${item.paramType!}</option>
                                    <option value="String">String</option>
                                    <option value="Integer">Integer</option>
                                    <option value="Long">Long</option>
                                    <option value="Float">Float</option>
                                    <option value="Double">Double</option>
                                    <option value="Boolean">Boolean</option>
                                    <option value="JsonObject">JsonObject</option>
                                    <option value="JsonArray">JsonArray</option>
                                </select>
                            </td>
                            <td class="console-text-align-center">
                                <input class="ng-pristine ng-valid  paramPosition"
                                       <#if item.isNotNull == true>checked="checked"
                                        </#if> <#if item.position == "PATH">disabled="disabled"</#if>
                                       type="checkbox">
                            </td>
                            <td>
                                <input value="${item.def!}"
                                       class="form-control w-25 paramDefault "
                                       type="text">
                            </td>
                            <td>
                                <input value="${item.describe!}"
                                       class="form-control w-25 paramDescribe"
                                       type="text">
                            </td>
                            <td>
    <span style="white-space:nowrap">
      <a id="editMore" href="javascript:;" class="ng-scope" onclick="senateEditMore(this)">编辑更多</a>|
      <a href="javascript:;" class="ng-scope" onclick="delParam(this)">移除</a>
    </span>
                            </td>
                        </tr>
                    </#list>
                </#if>

                </tbody>
            </table>
            <div class="pagination-gird-container console-clearfix">
    <span class=" console-button-wrap ng-isolate-scope" icon="add" size="tiny"
          theme="green" style="width: 100%;line-height: .8rem;">
        <label style="float: left;cursor: pointer;font-weight: normal;margin: 5px 0 0 10px;">
            <input type="checkbox" id="passBody"
                   class="form-check-input"
                   <#if context.api?? && context.api.passBody?exists><#if context.api.passBody == true >checked="checked"</#if></#if> onclick="passBodyFun()"> 请求体透传
        </label>
    <label style="float: left;cursor: pointer;font-weight: normal;margin: 5px 0 0 10px;"
           title="Body参数可以被Query获取,当Content-Type=application/x-www-form-urlencoded时有效,既query可以获取URL中的参数也可以获取body里面的参数">
        <input type="checkbox" id="bodyAsQuery"
               class="form-check-input"
        <#if context.api?? && context.api.bodyAsQuery?exists>
            <#if context.api.bodyAsQuery == true >
                checked="checked"
            </#if>
        <#else>
            checked="checked"</#if>> 请求体参数可以被QUERY解析
</label>
<a class="console-button console-button-green console-button-tiny addParams"
   style="width: 85px">
    <span>
        <span class="ng-scope ng-binding">增加一条</span>
    </span>
</a>
</span>
            </div>
            <div class="pagination-gird-container request-param-setter-errormessage ng-binding ng-hide">
                <i class="icon-no-2 console-mr1 console-inline-block"></i>
            </div>
        </div>
    </div>

</div>

